package per.jdz.proxy;

import per.jdz.common.constants.RpcProxy;
import per.jdz.spi.ExtensionLoader;

import java.io.IOException;

/**
 * @description:
 * @Author: Jdz
 * @CreateTime: 2024-03-10 19:26
 */
public class ProxyFactory {



    public static IProxy get(RpcProxy rpcProxy){
        return ExtensionLoader.getInstance().get(rpcProxy.name);

    }

    public static IProxy get(String name){
        return ExtensionLoader.getInstance().get(name);

    }

    public static void init() throws IOException, ClassNotFoundException {
        ExtensionLoader.getInstance().loadExtension(IProxy.class);
    }
}
